<?php
/**
 * Class for the database entity "movie"
 *
 * @author zonk
 */

class MovieModel {
	
	/**
	 * The id of the movie
	 * @var int
	 */
	private $movieid;
	
	/**
	 * The imdbID of the movie
	 * @var string
	 */
	private $imdbID;
	
	/**
	 * The title of the movie
	 * @var string
	 */
	private $name;
	
	/**
	 * The current rating of the movie
	 * @var float
	 */
	private $rating;
	
	/**
	 * The number of votes of the movie
	 * @var int
	 */
	private $votes;
	
	/**
	 * The year the movie was released
	 * @var string
	 */
	private $year;
	
	/**
	 * The date the database entry was cached the last time
	 * @var string
	 */
	private $cachedate;
	
	/**
	 * The genres which are linked to the movie
	 * @var ArrayObject
	 */
	private $genres;
	
	/**
	 * @param int $movieid;
	 * @param string $imdbID;
	 * @param string $name;
	 * @param float $rating;
	 * @param int $votes;
	 * @param string $year;
	 * @param string $cachedate;
	 * @param ArrayObject $genres;
	 */
	public function __construct($movieid, $imdbID, $name, $rating, $votes, $year, $cachedate, $genres) {
		$this->movieid = $movieid;
		$this->imdbID = $imdbID;
		$this->name = $name;
		$this->rating = $rating;
		$this->votes = $votes;
		$this->year = $year;
		$this->cachedate = $cachedate;
		$this->genres = $genres;
	}
	
	/**======================================
	 * Getter & Setter
	*=======================================
	*/
	//TODO implement util and the on demand loading of the arrayobjects
	
	/**
	 * 
	 * @return int
	 */
	public function getMovieid()
	{
	    return $this->movieid;
	}

	/**
	 * 
	 * @param int $movieid
	 */
	public function setMovieid($movieid)
	{
	    $this->movieid = $movieid;
	}

	/**
	 * 
	 * @return string
	 */
	public function getImdbID()
	{
	    return $this->imdbID;
	}

	/**
	 * 
	 * @param string $imdbID
	 */
	public function setImdbID($imdbID)
	{
	    $this->imdbID = $imdbID;
	}

	/**
	 * 
	 * @return string
	 */
	public function getName()
	{
	    return $this->name;
	}

	/**
	 * 
	 * @param string $name
	 */
	public function setName($name)
	{
	    $this->name = $name;
	}

	/**
	 * 
	 * @return float
	 */
	public function getRating()
	{
	    return $this->rating;
	}

	/**
	 * 
	 * @param float $rating
	 */
	public function setRating($rating)
	{
	    $this->rating = $rating;
	}

	/**
	 * 
	 * @return int
	 */
	public function getVotes()
	{
	    return $this->votes;
	}

	/**
	 * 
	 * @param int $votes
	 */
	public function setVotes($votes)
	{
	    $this->votes = $votes;
	}

	/**
	 * 
	 * @return string
	 */
	public function getYear()
	{
	    return $this->year;
	}

	/**
	 * 
	 * @param string $year
	 */
	public function setYear($year)
	{
	    $this->year = $year;
	}

	/**
	 * 
	 * @return string
	 */
	public function getCachedate()
	{
	    return $this->cachedate;
	}

	/**
	 * 
	 * @param string $cachedate
	 */
	public function setCachedate($cachedate)
	{
	    $this->cachedate = $cachedate;
	}

	/**
	 * 
	 * @return ArrayObject
	 */
	public function getGenres()
	{
	    return $this->genres;
	}

	/**
	 * 
	 * @param ArrayObject $genres
	 */
	public function setGenres($genres)
	{
	    $this->genres = $genres;
	}
}